package com.ruoyi.shop.service.impl;

import java.util.List;

import com.ruoyi.shop.mapper.CheShopMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.domain.CheShop;
import com.ruoyi.shop.service.ICheShopService;

/**
 * 商户管理Service业务层处理
 *
 * @author ruoyi
 * @date 2025-01-02
 */
@Service
public class CheShopServiceImpl implements ICheShopService {
    @Autowired
    private CheShopMapper cheShopMapper;

    @Override
    public CheShop selectCheShopByPhone(String phone) {
        return cheShopMapper.selectCheShopByPhone(phone);
    }

    /**
     * 查询商户管理
     *
     * @param id 商户管理主键
     * @return 商户管理
     */
    @Override
    public CheShop selectCheShopById(Long id) {
        return cheShopMapper.selectCheShopById(id);
    }

    /**
     * 查询商户管理列表
     *
     * @param cheShop 商户管理
     * @return 商户管理
     */
    @Override
    public List<CheShop> selectCheShopList(CheShop cheShop) {
        return cheShopMapper.selectCheShopList(cheShop);
    }

    @Override
    public List<CheShop> selectCheShopRank() {
        return cheShopMapper.selectCheShopRank();
    }

    /**
     * 新增商户管理
     *
     * @param cheShop 商户管理
     * @return 结果
     */
    @Override
    public int insertCheShop(CheShop cheShop) {
        return cheShopMapper.insertCheShop(cheShop);
    }

    /**
     * 修改商户管理
     *
     * @param cheShop 商户管理
     * @return 结果
     */
    @Override
    public int updateCheShop(CheShop cheShop) {
        return cheShopMapper.updateCheShop(cheShop);
    }

    @Override
    public int updateUserId(String phone) {
        return cheShopMapper.updateUserIdByPhone(phone);
    }
    /**
     * 批量删除商户管理
     *
     * @param ids 需要删除的商户管理主键
     * @return 结果
     */
    @Override
    public int deleteCheShopByIds(Long[] ids) {
        return cheShopMapper.deleteCheShopByIds(ids);
    }

    /**
     * 删除商户管理信息
     *
     * @param id 商户管理主键
     * @return 结果
     */
    @Override
    public int deleteCheShopById(Long id) {
        return cheShopMapper.deleteCheShopById(id);
    }
}
